
<link rel="stylesheet" href="/css/header.css">
<div class="wrapper">
    <h1><a href="/index.html"><img src="/images/logo.png" alt=""></a> </h1>
    <nav>
        <ul id="navTabs">
 
        </ul>

    </nav>
    <script type="text/html" id="navTemplate">
        {{each list item}}
        <li>
            <a href="/html/list.html?id={{item.id}}">{{item.name}}</a>
        </li>
        {{/each}}
    </script>
    <div class="log_reg infos navbar">
            <a href='/html/login.html' class='login'>登录</a> &nbsp;|&nbsp; 
            <a href='/html/register.html' class='register'>注册</a>         
    </div>
    <div class="out">
        <p><a href="/html/login.html">退出登录</a> </p>
    </div>

    <div class="choose">
         <a href="/html/basket.html">|<img src="/images/icon_basket_header.png" alt=""><span>0</span>|</a>
        
         <a href="" class="sh">上海 |</a>  
    </div>
</div>
<script>
        const userInfo = getCookie('userInfo')
        const userPwd = getCookie('userPwd')
        const login = document.querySelector('.log_reg')
        const out = document.querySelector('.out p')
        // console.log(out)
            if(userInfo){
                login.innerHTML = '欢迎您  '+userInfo   
            }
            login.onmouseover = ()=>{
                out.style.display = 'block'
            }
            login.onmouseout = ()=>{
                out.style.display = 'none'
            }
            out.onmouseover = ()=>{
                out.style.display = 'block'
            }
            out.onmouseout = ()=>{
                out.style.display = 'none'
            }
            out.onclick = () =>{
                deleteCookie('userInfo')
            }
                if(!userInfo){
                    login.onmouseover = ()=>{
                    out.style.display = 'none'
                }
               
            }
</script>
<script src="/lib/requirejs/require.js" data-main="/js/header"></script>

